package com.itheima.demo01;

import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.Properties;

public class Demo03 {
    public static void main(String[] args) throws IOException, ClassNotFoundException, NoSuchMethodException, IllegalAccessException, InstantiationException, InvocationTargetException {
        Properties prop = new Properties();
        ClassLoader classLoader = Demo03.class.getClassLoader();
        InputStream resourceAsStream = classLoader.getResourceAsStream("F:\\idea project\\javase_advance\\b.properties");
        prop.load(resourceAsStream);
        System.out.println(prop);
        String filename = prop.getProperty("filename");
        String method = prop.getProperty("method");
        Class clazz = Class.forName(filename);
        Object o = clazz.newInstance();
        Method show1 = clazz.getMethod(method);
        show1.invoke(o);
    }
}
